package com.commerce.common.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品实体�? */
@Data
@TableName("products")
@NoArgsConstructor
@AllArgsConstructor
public class Product {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private String name;
    
    @TableField("category_id")
    private Long categoryId;
    
    @TableField("brand_id")
    private Long brandId;
    
    @TableField("main_image")
    private String mainImage;
    
    private BigDecimal price;
    
    @TableField("original_price")
    private BigDecimal originalPrice;
    
    private Integer stock;
    
    private Integer sales;
    
    @TableField("is_hot")
    private Integer isHot;
    
    @TableField("is_new")
    private Integer isNew;
    
    @TableField("is_recommend")
    private Integer isRecommend;
    
    private Integer status;
    
    private String description;
    
    @TableField("create_time")
    private LocalDateTime createTime;
    
    @TableField("update_time")
    private LocalDateTime updateTime;
    
    // 非数据库字段
    @TableField(exist = false)
    private String categoryName;
    
    @TableField(exist = false)
    private String brandName;
} 
